package com.csdj.controller;

import com.csdj.pojo.Order;
import com.csdj.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class OrderController {
    @Autowired
    private OrderService orderService;

    @RequestMapping("/getOrder01" )
    @ResponseBody
    public String selectAll01() {
        List<Order> orders = orderService.selectAll();
        return "mybatis xml查询："+orders;
    }
    @RequestMapping("/getOrder02" )
    @ResponseBody
    public String selectAll02() {
        List<Order> orders = orderService.getBaseMapper().selectList(null);
        return "mybatisPlus 模版查询："+orders;
    }
}
